package com.qyer.search.model.mutable;

import com.qyer.search.enums.KeyType;

/**
 * Created by tangzheng on 16/9/1.
 */
public class PreferKey {

  private String id;
  private KeyType type;

  public PreferKey(String id, KeyType type) {
    this.id = id;
    this.type = type;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public KeyType getType() {
    return type;
  }

  public void setType(KeyType type) {
    this.type = type;
  }

  @Override public boolean equals(Object o) {
    if (this == o)
      return true;
    if (o == null || getClass() != o.getClass())
      return false;

    PreferKey preferKey = (PreferKey) o;

    if (!id.equals(preferKey.id))
      return false;
    return type == preferKey.type;

  }

  @Override public int hashCode() {
    int result = id.hashCode();
    result = 31 * result + type.hashCode();
    return result;
  }

  @Override public String toString() {
    return "PreferKey{" +
      "id='" + id + '\'' +
      ", type=" + type +
      '}';
  }
}
